home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / The World of Computer Software.iso / wed20g.zip / WINEDIT.MN_ < prev    next >
Text File  |  1992-12-02  |  14KB  |  387 lines

  1. ;  AutoExec Section is on top here.  Actually runs before file manager
  2. ; appears on the   screen
  3. ;
  4.         TAB=num2char(9)
  5.         CR=strcat(num2char(13),num2char(10))
  6.         Home=DirHome()
  7. ;
  8. ;       if !WinExist("Clock") then Run("Clock.exe","")
  9. ;
  10. ; customize the toolbar:
  11. ;         ;DEBUG(@ON)
  12. ;         ;WDelButton(9,@WRunCompile)
  13. ;         ;WDelButton(9,@WRunMake)
  14. ;         ;WDelButton(9,@WRunRebuild)
  15. ;         ;WDelButton(9,@WRunDebug)
  16. ;         ;WDelButton(9,@WRunExecute)
  17. ;         ;WDelButton(9,@WPrevError)
  18. ;         ;WDelButton(9,@WNextError)
  19. ;         ;WDelButton(9,@WHlpKeyWord)
  20. ;
  21. ;         WAddButton(@UNDOICON,      @WEDUNDO,      4)
  22. ;         WAddButton(@REDOICON,      @WEDREDO,      5)
  23. ;         WAddButton(@REPEATICON,    @WREPEAT,      10)
  24. ;
  25. ; try a couple of user written functions
  26. ;
  27. ;         WAddButton(@EXECUTEICON,   @WCALL1,       21)
  28. ;         DEBUG(@OFF)
  29. ;        wCallMacro(1)
  30.  
  31. ;;;;; Uncommenting this section give you the WordStar diamond key set.
  32. ;;;;;;You can substitute with your favorite keystrokes
  33. ;WordStar commands                 ; WordStar keyboard command definitions
  34. ; Cursor Left       \ ^S            ; Move cursor one character to the left
  35. ;        WEdLeft()
  36. ; Cursor Right      \ ^D            ; Move cursor one character to the right
  37. ;        WEdRight()
  38. ; Cursor Up         \ ^E            ; Move cursor to previous line
  39. ;        WEdUpLine()
  40. ; Cursor Down       \ ^X            ; Move cursor to next line
  41. ;        WEdDownLine()
  42. ; Home              \ ^A            ; Move cursor to beginning of line
  43. ;        WEdHome()
  44. ; End               \ ^F            ; Move cursor to end of line
  45. ;        WEdEnd()
  46. ; Delete line       \ ^Y            ; Move current line to clipboard
  47. ;        WEdCutLine()
  48.  
  49. Edit WinEdit Utility Menu   ; Manage WinEdit Utility menu and help files
  50.         a=FileLocate("winedit.mnu")
  51.         WFileOpen(a)
  52.         Drop(a)
  53.  
  54. _Key Word Help      \ +{F1}         ; Load help topic for word at cursor
  55.         call("wwwedit.dll","KEYWORDHELP")
  56.  
  57. Load Help File                    ; Load a help file (no keyword lookup)
  58.         TheFile=strcat(DirHome(),"HELP\WEHELP.INI")
  59.         Keys=IniItemizePvt("HelpAll",TheFile)
  60.         KeyMax=ItemCount(Keys,TAB)
  61.         KeyIndex=0
  62.         KeyValues=""
  63.  
  64.         :ieLoop
  65.         if KeyIndex==KeyMax then goto looped
  66.         KeyIndex=KeyIndex+1
  67.         ThisKey=ItemExtract(KeyIndex,Keys,TAB)
  68.         if (stricmp(ThisKey,"DEFAULT")==0) then goto ieloop
  69.         ThisValue=IniReadPvt("HelpAll",ThisKey,"???",TheFile)
  70.         KeyValues=strcat(KeyValues,ThisValue,"|")
  71.         goto ieLoop
  72.         
  73.         :looped
  74.         a=ItemSelect("Select Help File",strlower(KeyValues),"|")
  75.         if a=="" then goto DONE
  76.         b = FileLocate(strcat(DirHome(),"HELP\%a%"))
  77.         if b=="" then b=FileLocate(a)
  78.         if b=="" then Message("Helpfile %a% not found","Edit %TheFile%%CR%[HelpAll] section to%CR%point to help file location%CR%or put helpfile on DOS path.")
  79.                  else WinHelp(b,"CONTENTS","")
  80.         :DONE
  81.         Drop(TheFile,Keys,KeyMax,KeyIndex,KeyValues,ThisKey,ThisValue,a,b)
  82.  
  83. Generate C Tags                   ; Index source files
  84.         ; uses the TAGS.EXE program to generate WINEDIT.MRK file
  85.         ; that the next function uses to look up function names
  86.         ; in your source
  87.         RunWait("TAGS.EXE","-om -tWINEDIT.MRK *.c")
  88.         Message("Tags","Processing complete")
  89.  
  90. Go to tag                         ; Jump to function definition
  91.         ; looks up the current word in WINEDIT.MRK, loads the file,
  92.         ; and moves the cursor to the correct line
  93.         goto START
  94.         :GETWORD
  95.         a = AskLine("Go to tag", "Enter function definition to jump to:", "")
  96.         strupper(a)
  97.         len = strlen(a)
  98.         if len==0 then goto NOWORD
  99.         goto START2
  100.         :START
  101.         a=WEdGetWord()
  102.         strupper(a)
  103.         len = strlen(a)
  104.         if len==0 then goto GETWORD
  105.         :START2
  106.         b=FileLocate("winedit.mrk")
  107.         WFileOpen(b)
  108.         WFind(a,@TRUE,@FALSE)
  109.         WEdHome()
  110.         WEdStartSel()
  111.         WEdEnd()
  112.         WEdEndSel()
  113.         WEdCopy()
  114.         WWinClose()
  115.         line=ClipGet()
  116.         line2=strupper(line)
  117.         c=StrIndex(line2,a,0,@FWDSCAN)
  118.         d=StrIndex(line2," ",c,@FWDSCAN)
  119.         e=StrIndex(line2,"(",d,@FWDSCAN)
  120.         filename=StrSub(line2,d,e-d)
  121.         lineno=StrSub(line2,e+1,strlen(line2)-e-1)
  122.         WFileOpen(filename)
  123.         WEdGoToLine(lineno)
  124.         WEdHome()
  125.         Drop(len,b,line,line2,c,d,e,filename,lineno)
  126.         :NOWORD
  127.         Drop(a)
  128.  
  129.  
  130. Utilities      ;      Select from list of utilities
  131.  &Freespace on Local Drives   ; Display free disk space on drives
  132.  
  133.         Drive=DiskScan(2)     ; 2 is the code for local hard drives
  134.         Dmax=strlen(Drive)
  135.         DIndex=1
  136.         TotalSize=0
  137.         DriveReport=""
  138.  
  139.         :COUNTSPACE
  140.         NextDrive=StrSub(Drive,Dindex,1)
  141.         a=DiskFree(NextDrive)/1024
  142.         TotalSize=a+TotalSize
  143.         DriveReport=strcat(DriveReport,NextDrive," = ",a,"K","@")
  144.         DIndex=Dindex+3  ;each entry is 3 bytes long
  145.         if DIndex<=Dmax then goto COUNTSPACE
  146.         ItemSelect("Total Space Available = %TotalSize%K",DriveReport,"@")
  147.         Drop(xxx,TotalSize,DriveReport,NextDrive,LastDrive)
  148.  
  149.  &Wallpaper                   ; Change the desktop wallpaper
  150.            DirChange(dirWindows(0))
  151.            a=FileItemize("*.BMP")
  152.            a=strcat("-None- ",a)
  153.            a=ItemSelect("Select New Wallpaper",a," ")
  154.            terminate(a=="","Wallpaper","No wallpaper selected")
  155.            if a=="-None-" then Wallpaper("",0)
  156.            if a=="-None-" then exit
  157.            tile=@FALSE
  158.            if FileSize(a)<40000 then tile=@TRUE  
  159.            ;if bmp size less than 40K, assume tile, else center
  160.            Wallpaper(a,tile)
  161.            drop(a,b,tile)
  162.  Edit &INI files              ; Assisted editing of INI files
  163.         DirChange(DirWindows(0))
  164.         canned="BYEBYE"
  165.         IniFiles=""
  166.  
  167.         :UP1
  168.         canned="byebye"
  169.         If IniFiles!="" then goto inied
  170.         IniFiles=FileItemize("*.INI")
  171.         :inied
  172.         TheFile=ItemSelect("Choose Desired INI file",IniFiles," ")
  173.         if TheFile=="" then goto newini
  174.         Sections=""
  175.  
  176.         :UP2
  177.         canned="up1"
  178.         if Sections!="" then goto sected
  179.         Sections=IniItemizePvt("",TheFile)
  180.         :SECTED
  181.         Section=ItemSelect("%TheFile% - Choose Section",Sections,TAB)
  182.         if Section=="" then goto AddSect
  183.         KeyValues=""
  184.  
  185.         :UP3
  186.         canned="up2"
  187.         if KeyValues!="" then goto looped
  188.         Keys=IniItemizePvt(Section,TheFile)
  189.         KeyMax=ItemCount(Keys,TAB)
  190.         KeyIndex=0
  191.  
  192.         :Loop
  193.         if KeyIndex==KeyMax then goto looped
  194.         KeyIndex=KeyIndex+1
  195.         ThisKey=ItemExtract(KeyIndex,Keys,TAB)
  196.         ThisValue=IniReadPvt(Section,ThisKey,"???",TheFile)
  197.         KeyValues=strcat(KeyValues,ThisKey,"= ",ThisValue,TAB)
  198.         goto Loop
  199.  
  200.         :looped
  201.         Key=ItemSelect("%TheFile% [%Section%] - Choose Keyword",KeyValues,TAB)
  202.         if Key=="" then goto AddKey
  203.         Key=ItemExtract(1,Key,"=")
  204.  
  205.         Value=IniReadPvt(Section,Key,"???",TheFile)
  206.         goto entkey
  207.  
  208.  
  209.         :newini
  210.         canned="UP1"
  211.         TheFile=Askline("Making NEW INI file","Enter new INI file name","*.INI")
  212.         if (TheFile=="*.INI" || TheFile=="") then goto newini
  213.         IniFIles=""
  214.         goto AddSectNewIni
  215.  
  216.         :AddSect
  217.         canned="up2"
  218.         :AddSectNewIni
  219.         Section=AskLine("Add New Section to INI File","Enter new section name for%CR%   %TheFile%%CR%      [?????]","")
  220.         Sections=""
  221.         goto AddKeyNewSect
  222.  
  223.         :AddKey
  224.         canned="up3"
  225.         :AddKeyNewSect
  226.         Key=AskLine("Add New Keyword to INI File","Enter new key name for%CR%   %TheFile%%CR%      [%Section%]","")
  227.         Value="(Undefined)"
  228.         KeyValues=""
  229.         goto EntKeyNewKey
  230.  
  231.         :ENTKEY
  232.         canned="up3"
  233.         :EntKeyNewkey
  234.         NewValue=AskLine("Modify INI File Keyword","%TheFile%%CR%   [%Section%]%CR%      %Key% = %Value%",Value)
  235.         if NewValue!=Value then iniwritepvt(Section,Key,NewValue,TheFile)
  236.         KeyValues=""
  237.         goto up3
  238.  
  239.         :CANCEL
  240.         goto %Canned%
  241.  
  242.         :BYEBYE
  243.         exit
  244.  
  245.  Clipboard Tricks             ; Clipboard management using the WIL commands
  246. ;  Path and Filename to Clipboard
  247. ;        Clipput(strcat(DirGet(),CurrentFile()))
  248.   Copy &FormFeed to Clipboard
  249.        Clipput(Num2char(12))
  250.   Copy &Special Characters to Clipboard
  251.        a=" í| ó| ú| ñ| Ñ| ª| º| ¿| ⌐| ¬|"       ;161 thru 170
  252.        b=" ½| ¼| ¡| «| »| ░| ▒| ▓| │| ┤|"       ;171 thru 180
  253.        c=" ╡| ╢| ╖| ╕| ╣| ║| ╗| ╝| ╜| ╛|"       ;181 thru 190
  254.        d=" ┐| └| ┴| ┬| ├| ─| ┼| ╞| ╟| ╚|"       ;191 thru 200
  255.        e=" ╔| ╩| ╦| ╠| ═| ╬| ╧| ╨| ╤| ╥|"       ;201 thru 210
  256.        f=" ╙| ╘| ╒| ╓| ╫| ╪| ┘| ┌| █| ▄|"       ;211 thru 220
  257.        g=" ▌| ▐| ▀| α| ß| Γ| π| Σ| σ| µ|"       ;221 thru 230
  258.        h=" τ| Φ| Θ| Ω| δ| ∞| φ| ε| ∩| ≡|"       ;231 thru 240
  259.        i=" ±| ≥| ≤| ⌠| ⌡| ÷| ≈| °| ∙| ·|"       ;241 thru 250
  260.        j=" √| ⁿ| ²| ■|  "                       ;251 thru 255
  261.        a=strcat(a,b,c,d,e,f,g,h,i,j)
  262.        Drop(b,c,d,e,f,g,h,i,j)
  263.        a=ItemSelect("Choose a character",a,"|")
  264.        a=strsub(a,2,1)
  265.        ClipPut(a)
  266.        Drop(a)
  267.  
  268.  
  269. Accessories
  270.  Appointment   Scheduling
  271.            run("Calendar.exe","")
  272.  Calculator
  273.            run("calc.exe","")
  274.  
  275.  C&lipboard
  276.         errormode(@off)
  277.         terminate(winactivate("Clipboard"),"","") ;Already Running
  278.         errormode(@cancel)
  279.         run("Clipbrd.exe","")
  280.  
  281.  Clock
  282.         run("clock.exe","")
  283.  
  284.  Control &Panel
  285.         errormode(@off)
  286.         terminate(winactivate("Control Panel"),"","")
  287.         errormode(@cancel)
  288.         run("control.exe","")
  289.  Cardfile
  290.            run("cardfile.exe","")
  291.  
  292.  Notepad Editor
  293.            run("notepad.exe","")
  294.  
  295.  Paint
  296.            run("pbrush.exe","")
  297.  
  298.  Write
  299.            run("write.exe","")
  300.  
  301.  Run System Confi&guration Editor
  302.            run("sysedit.exe","")  ;takes care of itself
  303.  Run Windows Setup
  304.         DirChange(DirWindows(0))
  305.         run("setup.exe","")
  306.         drop(a)
  307.  _PIF Edi&t...
  308.         DirChange(FilePath(FileLocate("_default.pif")))
  309.         a=FileItemize("*.PIF")
  310.         if a==""  then DirChange(FilePath(FileLocate("_default.pif")))
  311.         if a=="" then a=FileItemize("*.PIF")
  312.         a=ItemSelect("Choose a PIF File to edit",a," ")
  313.         run("pifedit.exe",a)
  314.         exit
  315. _&System Information
  316.        wintype="retail"
  317.        if WinMetrics(22) then wintype="debug"
  318.  
  319.         wc=WinConfig()
  320.         if !(wc&1) then mode="Real"
  321.         if wc&16 then mode="Standard"
  322.         if wc&32 then mode="Enhanced"
  323.  
  324.         if wc&2 then cpu=286
  325.         if wc&4 then cpu=386
  326.         if wc&8 then cpu=486
  327.         if wc&64 then cpu=8086
  328.         if wc&128 then cpu=80186
  329.  
  330.         Sysinfo=strcat(cpu,' ',mode,' ',wintype,' Windows ',WinVersion(1),'.',WinVersion(0),CR)
  331.  
  332.         math="No math"
  333.         if wc&1024 then math="Math"
  334.         mouse="No Mouse"
  335.         if WinMetrics(19) then mouse="Mouse"
  336.  
  337.         Sysinfo=strcat(sysinfo,math," co-processor.   ",mouse,' available.',CR)
  338.  
  339.         sysinfo=strcat(sysinfo,WinMetrics(0),'x',WinMetrics(1)," video resolution.  ",WinMetrics(-1),"  colors.",CR)
  340.  
  341.         ErrorMode(@OFF)
  342.         LastError()
  343.         PlayMedia("Status WaveForm Ready")
  344.         ErrorMode(@CANCEL)
  345.         if LastError()!=1193 then sysinfo=strcat(sysinfo,"Windows multimedia extensions present.",CR)
  346.  
  347.         bug=NetGetCaps(2)
  348.         if bug==0 then math="No n"
  349.         if bug!=0 then math="N"
  350.         if bug==256 then math="Microsoft n"
  351.         if bug==512 then math="Lan Manager n"
  352.         if bug==768 then math="Novell NetWare n"
  353.         if bug==1024 then math="Banyan Vines n"
  354.         if bug==1280 then math="10 Net n"
  355.         sysinfo=strcat(sysinfo,math,"etwork installed.",CR)
  356.  
  357.         bug=WinResources(0)/1024   ; Compute memory avail
  358.         math=strlen(bug)
  359.         if math>3 then bug=strcat(strsub(bug,1,math-3),',',strsub(bug,math-2,3))
  360.  
  361.         sysinfo=strcat(sysinfo,CR,bug," KB Free Memory",CR)
  362.         sysinfo=strcat(sysinfo,WinResources(2),"%% System Resources Free (",WinResources(3),"%% GDI, ",WinResources(4),"%% User)",CR)
  363.  
  364.         sysinfo=strcat(sysinfo,"DOS ",DosVersion(1),'.',DosVersion(0),"  using ",environment("COMSPEC"),CR)
  365.         disks=DiskScan(1)
  366.         if disks!="" then sysinfo=strcat(sysinfo,"Floppies ",disks,CR)
  367.         disks=DiskScan(2)
  368.         if disks!="" then sysinfo=strcat(sysinfo,"Hard Disks ",disks,CR)
  369.         disks=DiskScan(4)
  370.         if disks!="" then sysinfo=strcat(sysinfo,"Network Disks ",disks,CR)
  371.         sysinfo=strcat(sysinfo,"Windows Directory ",DirWindows(0),CR)
  372.         sysinfo=strcat(sysinfo,"System  Directory ",DirWindows(1),CR)
  373.         sysinfo=strcat(sysinfo,CR,"WIL Interpreter Ver ",VersionDll())
  374.  
  375.         ver=Version()
  376.         Message("WinEdit %ver% SysInfo",Sysinfo)
  377.  
  378. Interactive Execution
  379.           if !IsDefined(uyit65) then uyit65="Message( , )"
  380.           :NEXT
  381.           uyit65=AskLine("Interactive Execution","Enter Command",uyit65)
  382.           execute %uyit65%
  383.           goto NEXT
  384.           
  385.  
  386.         
  387.